package com.itheima.job;

import com.itheima.dao.OrderSettingDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component("clearOrderSettingJob")
public class ClearOrderSettingjob {

    @Autowired
    private OrderSettingDao orderSettingDao;


    public void clearOrderDate(){
        //获得当前 时间
        Date date = new Date();

        // 调用方法 把当前时间作为参数传递     根据当前时间    删除  当前时间"之前的数据"
        Integer count = orderSettingDao.clearOrderDate(date);

        System.out.println("删除了" + count + "信息");

    }

}
